﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VRB_0._1
{
    class AnimatedObject : VisualObject
    {
        public Animation Animation;

        public enum Direction
        {
            LEFT, RIGHT, ON, OFF
        }

      

        public Direction direction;
        public Direction Startdirection;

        public override int Width 
        {
            get { return Animation.FrameWidth; } 
        }
        public override int Height 
        {
            get { return Animation.FrameHeight; } 
        }
        public virtual void Initialize(Viewport viewport, Animation animation, Vector2 position, Direction direction)
        {
            base.Initialize(viewport, position);
            this.Animation = animation;
            this.direction = direction;
            Startdirection = direction;
            this.Active = true;           
        }
        public override void Update(GameTime gameTime)
        {
            Animation.Position = Position;
            Animation.Update(gameTime);
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            Animation.Draw(spriteBatch);
        }
        public override void  Restart()
        {
            direction = Startdirection;
            base.Restart();
        }

    

    }
}
